# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=mailimporter
pkgver=23.08.4
pkgrel=0
pkgdesc="KDE PIM library providing support for mail applications"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine -> akonadi
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://kontact.kde.org/"
license="GPL-2.0-or-later"
depends_dev="
	akonadi-dev
	akonadi-mime-dev
	karchive5-dev
	kconfig5-dev
	kcoreaddons5-dev
	ki18n5-dev
	kmime-dev
	libkdepim-dev
	pimcommon-dev
	qt5-qtbase-dev
	"
makedepends="
	$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/pim/mailimporter.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/mailimporter-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
504920ca89ae9b91dfba97c76ed1f3af868c479b9622a6812484856cf5e5381b6f211d1d5eafdae8830e4ce14fe2490e88d4cb4d209baba291242456554f9243  mailimporter-23.08.4.tar.xz
"
